<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{.title}}</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css">
</head>
<body>

<!--navbar start -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="/index">云盘</a>
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        <ul class="navbar-nav mr-auto">
            <li {{if eq 1 .active}}class="nav-item active"{{end}}><a class="nav-link" href="/index">分享大厅</a></li>
            {{if ne 0 .role}}
                <li {{if eq 2 .active}}class="nav-item active"{{end}}><a class="nav-link" href="/f">私人文件</a></li>
                <li {{if eq 3 .active}}class="nav-item active"{{end}}><a class="nav-link" href="/sf">个人分享</a></li>
                <li {{if eq 4 .active}}class="nav-item active"{{end}}><a class="nav-link" href="/u">用户列表</a></li>
                <li {{if eq 5 .active}}class="nav-item active"{{end}}> <a class="nav-link" href="/uupdate?uid={{.uid}}">个人信息 ({{.username}})</a> </li>
            {{end}}
        </ul>
        <ul class="nav navbar-nav navbar-right">
            <li class="nav-item justify-content-end {{if eq 0 .active}}active{{end}}" >
                {{if eq 1 .role}}<a class="nav-link" href="/loginout">登出</a>{{end}}
                {{if eq 0 .role}}<a class="nav-link" href="/login">登陆</a>{{end}}
                {{if eq 5 .role}}<a class="nav-link" href="/loginout">登出</a>{{end}}
            </li>
        </ul>
    </div>
</nav>
{{if ne "" .error}}
    <div class="alert alert-success" role="alert">
        {{.error}}
    </div>
{{end}}
<!--navbar end -->